Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collected small changes and bugfixes #2717

Merged
merged 30 commits into from Apr 23, 2021

Conversation

akohlmey
Copy link
Member

@akohlmey akohlmey commented Apr 22, 2021

Summary

This pull request combines multiple small changes and bugfixes

Author(s)

Axel Kohlmeyer, Temple U

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

No known issues

Implementation Notes

The following individual changes

  • Fix whitespace issues introduced in recent merges
  • Add ASCII substitution support for Unicode general punctuation left/right single/double quotation marks in LAMMPS input script
  • Fix a memory leak in fix atom/swap
  • Fix bug in spin/kk atom style border communication introduced in PR Adding a spin/kokkos atom style #2693
  • Fix cut-n-paste bug and incorrect detection of number of active pair style instance introduced in PR Improvement of the SPIN package by removing a limitation #2714. Also improve accuracy of style name matching.
  • Use library name consistent with other libraries build during LAMMPS build for PACE lib
  • Update package lists in CMake presets and src/Makefile variables to include recent additions
  • Silence some compiler warnings
  • Output compiled in accelerator configuration with -help
  • Download a specific MathJax version for building the html/epub docs. Update the version to the latest bugfix release, 3.1.4
  • Tweak a few epsilon values for pair style unit tests so they pass with GPU acceleration in mixed precision mode

Post Submission Checklist

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system

@akohlmey akohlmey marked this pull request as ready for review April 22, 2021 18:22

if (nlangspin > 0) {
locklangevinspin = new FixLangevinSpin*[nprecspin];
locklangevinspin = new FixLangevinSpin*[nlangspin];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julient31 ... and here we have a cut-n-paste bug that was detected by using static code analysis with coverity scan.

@@ -197,18 +203,18 @@ void FixNVESpin::init()
int count1 = 0;
if (npairspin == 1) {
count1 = 1;
spin_pairs[0] = (PairSpin *) force->pair_match("spin",0,0);
spin_pairs[0] = (PairSpin *) force->pair_match("^spin",0,0);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julient31 please note that not using the caret (^) can lead to false matches, same as for comparisons with strstr(). There may be styles that are not in the SPIN package and just by accident contain the string "spin" somewhere.
That is why we introduced the utils::strmatch() function, which has been applied here and is used internally by Force::pair_match() for inexact matches. Searching for styles that start with the string spin is much more specific.

@@ -172,15 +175,18 @@ void FixNVESpin::init()

// loop 1: obtain # of Pairs, and # of Pair/Spin styles

if (force->pair_match("spin",0,0)) { // only one Pair/Spin style
pair = force->pair_match("spin",0,0);
npairs = pair->instance_total;
Copy link
Member Author

@akohlmey akohlmey Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julient31 I noticed this while improving the inexact matches. Pair::instance_total is not the total number of pair styles but the total number of pair styles ever created. This is to have a unique number to identify pair styles that are otherwise the same, e.g. when using the same pair style as a hybrid sub-style. This is used for example by the neighbor list code to by able to distinguish individual neighbor list requests. So if you replace an initial pair style (say lj/cut with morse) its value will become 2 even though there is only one pair style instance active.

@akohlmey akohlmey requested a review from athomps as a code owner April 23, 2021 20:40
src/velocity.cpp Outdated
arg[1] = group->names[igroup];
arg[2] = (char *) "temp";
temperature = new ComputeTemp(lmp,3,arg);
modify->add_compute(fmt::format("velocity_temp {} temp"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akohlmey that was too simple ;-)

Suggested change
modify->add_compute(fmt::format("velocity_temp {} temp"));
modify->add_compute(fmt::format("velocity_temp {} temp", group->names[igroup]));

@akohlmey akohlmey merged commit 5933750 into lammps:master Apr 23, 2021
@akohlmey akohlmey deleted the collected-small-changes branch April 23, 2021 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants